// 简单的使用示例
'use strict';
const uniPush = uniCloud.getPushManager({appId:"__UNI__8DA400C"}); //注意这里需要传入你的应用appId
exports.main = async (event, context) => {
	
	//console.info('接收到的参数是:',event);
	//接收到的参数,客户端id
	let cid = event.queryStringParameters.cid;
	if(cid){
		console.info('开始push',cid);
		let title = event.queryStringParameters.title||'才能招标';
		let content = event.queryStringParameters.body ||'最近的招标信息已获取,请查收!';
		//根据类型判断,是打开招标zhaobiao,还是打开企业信息company
		let openType = event.queryStringParameters.openType ||'zhaobiao';
		let busId = event.queryStringParameters.busId ; //业务ID,招标id或者企业id
		let stats = await uniPush.sendMessage({
			"push_clientid": cid, 	//填写上一步在uni-app客户端获取到的客户端推送标识push_clientid
			"title": title,	
			"content": content,
			"payload": {
				"openType":openType,
				"busId":busId
			}
		});
		console.info('push状态',stats);
	}
	
	return "yes";
};